<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div id="app">
        <table>
            <thead>
                <tr>
                    <th v-for="title in Object.keys(userList[0])">{{title}}</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="user in userList">
                    <td>{{user.id}}</td>
                    <td>{{user.name}}</td>
                    <td>{{user.age}}</td>
                </tr>
            </tbody>
        </table>
    </div>

    <!-- 引入vue -->
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                userList: [
                    { "id": 1, "name": '张三', "age": 18 },
                    { "id": 2, "name": '张三', "age": 18 },
                    { "id": 3, "name": '张三', "age": 18 },
                    { "id": 4, "name": '张三', "age": 18 },

                ]
            }
        })
    </script>


</body>

</html>